{include file="index/header" /}
<link rel="stylesheet" href="__PUBLIC__css/jquery.bigautocomplete.css" type="text/css" />
<script type="text/javascript" src="__PUBLIC__js/jquery.bigautocomplete.js"></script>
<body>
<div class="panel admin-panel margin-top" id="add">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 增加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action=""  enctype="multipart/form-data" onkeydown="if(event.keyCode==13){return false;}"> 
    	<div class="form-group">
        <div class="label">
          <label>班级名称：</label>
        </div>
        <div class="label" style="width:5%;overflow:inherit">
          <label>{$data.class_name}</label>
        </div>
      </div>   
      <div class="form-group">
        <div class="label">
          <label>学生手机号或邮箱：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" id="tt" name="phone" value="" data-validate="required:请输入手机号" AUTOCOMPLETE="OFF"/>
          <input type="hidden" name="user_id" value="0">
          <div class="tips"></div>
        </div>
     </div>
     <input type="hidden" value="{$data.class_id}" name="class_id"  />
     <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button_student bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body></html>
<script type="text/javascript">
  $(function(){
    $("#tt").bigAutocomplete({
        width:543,
        data:aaa(),
        callback:function(data){
            $("input[name=user_id]").val(data.id);
        }
    });
});
    function aaa(){
        var dat = [];
         $.ajax({
            url :"/admin/classes/getstudent",
            dataType:"json",
            async : false,
            success:function(obj){
                dat = obj
            },
            error:function(obj){
                console.log(obj);
            }
        });
         return dat;
    }
</script>